package com.yic.module.qms.framework.datapermission.config;

import com.yic.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
import com.yic.module.qms.dal.dataobject.inspectentry.InspectEntryDO;
import com.yic.module.qms.dal.dataobject.inspectprocess.InspectProcessDO;
import com.yic.module.qms.dal.dataobject.inspectscheme.InspectSchemeDO;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * QMS 模块的数据权限 Configuration
 *
 * @author 芋道源码
 */
@Configuration(proxyBeanMethods = false)
public class QmsDataPermissionConfiguration {

    @Bean
    public DeptDataPermissionRuleCustomizer qmsDeptDataPermissionRuleCustomizer() {
        return rule -> {
            // 检验项
            rule.addFactoryColumn(InspectEntryDO.class);
            // 检验方案
            rule.addFactoryColumn(InspectSchemeDO.class);
            // 过程检验
            rule.addFactoryColumn(InspectProcessDO.class);
            rule.addUserColumn(InspectProcessDO.class);
        };
    }
}
